package com.heima.behavior.controller;


import com.heima.behavior.pojos.UserLikeBehavior;
import com.heima.behavior.service.UserBehaviorService;
import com.heima.model.behavior.dtos.UserLoveDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 用户行为控制层
 */
@RestController
@RequestMapping("/api/v1")
public class UserBehaviorController {
    @Autowired
    private UserBehaviorService userBehaviorService;

    /**
     *用户点赞
     * @return
     */
    @PostMapping("/likes_behavior")
    public ResponseResult userLike(@RequestBody UserLikeBehavior userLikeBehavior){
        return userBehaviorService.likeBehavior(userLikeBehavior);
    }

    /**
     * 用户喜欢
     */
    @PostMapping("/un_likes_behavior")
    public ResponseResult userLove(@RequestBody UserLoveDto userLoveDto){
        return userBehaviorService.loveBehavior(userLoveDto);
    }

}
